I wouldn't take much from the hardware diagnostic. All it's doing for a fan is probably just seeing if it powers up. A loose wire would not shut the computer down - it would prevent it from starting in the first place. You've got an overheating issue, quite possibly a graphics card problem. I would be very surprised if it's anything else.